<template>
  <div class="app-container">
    <!-- 高级查询 -->
    <el-form v-show="searchVisible" ref="queryForm" :model="queryParams" :inline="true">
      <el-form-item label=":">
        <el-input v-model="queryParams.contractNo" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.contractName" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.purchaseOrderNo" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.companyNo" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.dutyPerson" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.contractProperty" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.tradeTermDesc" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.projectName" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.verdorCode" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.vendornm" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.consigneeId" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.consigneeName" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-date-picker v-model="queryParams.contractSignDate" type="date" value-format="yyyy-MM-dd" size="small" placeholder="选择" clearable />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.contractSignAddress" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-date-picker v-model="queryParams.contractEffectDate" type="date" value-format="yyyy-MM-dd" size="small" placeholder="选择" clearable />
      </el-form-item>
      <el-form-item label=":">
        <el-date-picker v-model="queryParams.contractUneffectDate" type="date" value-format="yyyy-MM-dd" size="small" placeholder="选择" clearable />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.currencyCode" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.paymenTerms" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.priceUneffectDate" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.productCode" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.productCodeName" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.departureCountry" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.departureHarbor" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.deliveryCountry" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.deliveryHarbor" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.deliveryAddress" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.overseasFreightFee" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.domesticFreightFee" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.insuranceExpense" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.palletCost" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.creditCost" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.commission" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.deliveryTermDesc" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.deliveryTerm" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.version" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.noteText" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.dutyDepartmentNo" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.customerName" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.customerNo" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.settlementCurrencyNo" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.projectNo" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.supplierSite" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.pickupAddress" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.depart" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.destination" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.paymentTerm" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.departPort" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.destPort" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.departPortAddress" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.destPortAddress" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.totProvect" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.nextProver" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.contractUploadPath" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.lastProver" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.docCt" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.attachment1" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.attachment2" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.attachment3" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.attachment4" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.attachment5" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.contractdoc4" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.contractdoc3" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.contractdoc2" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.contractdoc1" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.contractdoc5" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.attachmentotherdoc1" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.attachmentotherdoc2" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.contractdocname" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.contractdocname2" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="是否为外贸合同:">
        <el-input v-model="queryParams.isForeignTrade" size="small" placeholder="请输入是否为外贸合同" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.outWarehouseAfterPayYn" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.inWarehouseAfterPayDays" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.invoiceAfterpayYn" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.inWarehouseAfterPayYn" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.invoiceAfterPayDays" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.payAfterOutWarehouseDays" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.prePayPercentBeforeOut" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.proveText" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.proveTextOne" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.proveTextTwo" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.proveTextThree" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="盈利率:">
        <el-input v-model="queryParams.profitRequested" size="small" placeholder="请输入盈利率" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="预估费用:">
        <el-input v-model="queryParams.estimateFee" size="small" placeholder="请输入预估费用" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.dutyPersonName" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.contractEstimateNo" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.pingshenYn" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.vendorAddress" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.vendorForShort" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.consigneeAddress" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.consigneeShortName" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-date-picker v-model="queryParams.pingshengDate" type="date" value-format="yyyy-MM-dd" size="small" placeholder="选择" clearable />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.specProveUid" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.currentBuyerCredit" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.currentSellerCredit" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.materialProductBuyPublishNo" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.materialProductSalePublishNo" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="创建时间:">
        <el-date-picker v-model="queryParams.createDate" type="date" value-format="yyyy-MM-dd" size="small" placeholder="选择创建时间" clearable />
      </el-form-item>
      <el-form-item label="更新时间:">
        <el-date-picker v-model="queryParams.updateDate" type="date" value-format="yyyy-MM-dd" size="small" placeholder="选择更新时间" clearable />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.creditBillNo" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item>
        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <!-- 工具栏 -->
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button v-hasPermission="['contract:conContract:insert']" type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button v-hasPermission="['contract:conContract:update']" type="success" icon="el-icon-edit" size="mini" :disabled="isSingle" @click="handleEdit">修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button v-hasPermission="['contract:conContract:delete']" type="danger" icon="el-icon-delete" size="mini" :disabled="isMultiple" @click="handleRemove">删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button v-hasPermission="['contract:conContract:export']" type="warning" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
      </el-col>
      <right-toolbar :show-search.sync="searchVisible" @queryTable="handleQuery" />
    </el-row>

    <!-- 数据列表 -->
    <el-table v-loading="loading" :data="page.records" highlight-current-row @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="ID" align="center" prop="id" />
      <el-table-column label="" align="center" prop="contractNo" />
      <el-table-column label="" align="center" prop="contractName" />
      <el-table-column label="" align="center" prop="purchaseOrderNo" />
      <el-table-column label="" align="center" prop="companyNo" />
      <el-table-column label="" align="center" prop="dutyPerson" />
      <el-table-column label="" align="center" prop="contractType" />
      <el-table-column label="" align="center" prop="contractProperty" />
      <el-table-column label="" align="center" prop="tradeTermDesc" />
      <el-table-column label="" align="center" prop="projectName" />
      <el-table-column label="" align="center" prop="verdorCode" />
      <el-table-column label="" align="center" prop="vendornm" />
      <el-table-column label="" align="center" prop="consigneeId" />
      <el-table-column label="" align="center" prop="consigneeName" />
      <el-table-column label="" align="center" prop="contractSignDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.contractSignDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="" align="center" prop="contractSignAddress" />
      <el-table-column label="" align="center" prop="contractEffectDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.contractEffectDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="" align="center" prop="contractUneffectDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.contractUneffectDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="" align="center" prop="paymentType" />
      <el-table-column label="" align="center" prop="currencyCode" />
      <el-table-column label="" align="center" prop="paymenTerms" />
      <el-table-column label="" align="center" prop="priceUneffectDate" />
      <el-table-column label="" align="center" prop="productCode" />
      <el-table-column label="" align="center" prop="productCodeName" />
      <el-table-column label="" align="center" prop="transportType" />
      <el-table-column label="" align="center" prop="departureCountry" />
      <el-table-column label="" align="center" prop="departureHarbor" />
      <el-table-column label="" align="center" prop="deliveryCountry" />
      <el-table-column label="" align="center" prop="deliveryHarbor" />
      <el-table-column label="" align="center" prop="deliveryAddress" />
      <el-table-column label="" align="center" prop="overseasFreightFee" />
      <el-table-column label="" align="center" prop="domesticFreightFee" />
      <el-table-column label="" align="center" prop="insuranceExpense" />
      <el-table-column label="" align="center" prop="palletCost" />
      <el-table-column label="" align="center" prop="creditCost" />
      <el-table-column label="" align="center" prop="commission" />
      <el-table-column label="" align="center" prop="deliveryTermDesc" />
      <el-table-column label="" align="center" prop="deliveryTerm" />
      <el-table-column label="" align="center" prop="version" />
      <el-table-column label="" align="center" prop="noteText" />
      <el-table-column label="" align="center" prop="status" />
      <el-table-column label="" align="center" prop="dutyDepartmentNo" />
      <el-table-column label="" align="center" prop="customerName" />
      <el-table-column label="" align="center" prop="customerNo" />
      <el-table-column label="" align="center" prop="settlementCurrencyNo" />
      <el-table-column label="" align="center" prop="projectNo" />
      <el-table-column label="" align="center" prop="type" />
      <el-table-column label="" align="center" prop="supplierSite" />
      <el-table-column label="" align="center" prop="pickupAddress" />
      <el-table-column label="" align="center" prop="depart" />
      <el-table-column label="" align="center" prop="destination" />
      <el-table-column label="" align="center" prop="paymentTerm" />
      <el-table-column label="" align="center" prop="departPort" />
      <el-table-column label="" align="center" prop="destPort" />
      <el-table-column label="" align="center" prop="departPortAddress" />
      <el-table-column label="" align="center" prop="destPortAddress" />
      <el-table-column label="" align="center" prop="totProvect" />
      <el-table-column label="" align="center" prop="nextProver" />
      <el-table-column label="" align="center" prop="contractUploadPath" />
      <el-table-column label="" align="center" prop="lastProver" />
      <el-table-column label="" align="center" prop="approveStatus" />
      <el-table-column label="" align="center" prop="docCt" />
      <el-table-column label="" align="center" prop="attachment1" />
      <el-table-column label="" align="center" prop="attachment2" />
      <el-table-column label="" align="center" prop="attachment3" />
      <el-table-column label="" align="center" prop="attachment4" />
      <el-table-column label="" align="center" prop="attachment5" />
      <el-table-column label="" align="center" prop="contractdoc4" />
      <el-table-column label="" align="center" prop="contractdoc3" />
      <el-table-column label="" align="center" prop="contractdoc2" />
      <el-table-column label="" align="center" prop="contractdoc1" />
      <el-table-column label="" align="center" prop="contractdoc5" />
      <el-table-column label="" align="center" prop="attachmentotherdoc1" />
      <el-table-column label="" align="center" prop="attachmentotherdoc2" />
      <el-table-column label="" align="center" prop="contractdocname" />
      <el-table-column label="" align="center" prop="contractdocname2" />
      <el-table-column label="是否为外贸合同" align="center" prop="isForeignTrade" />
      <el-table-column label="" align="center" prop="outWarehouseAfterPayYn" />
      <el-table-column label="" align="center" prop="inWarehouseAfterPayDays" />
      <el-table-column label="" align="center" prop="invoiceAfterpayYn" />
      <el-table-column label="" align="center" prop="inWarehouseAfterPayYn" />
      <el-table-column label="" align="center" prop="invoiceAfterPayDays" />
      <el-table-column label="" align="center" prop="payAfterOutWarehouseDays" />
      <el-table-column label="" align="center" prop="prePayPercentBeforeOut" />
      <el-table-column label="" align="center" prop="proveText" />
      <el-table-column label="" align="center" prop="proveTextOne" />
      <el-table-column label="" align="center" prop="proveTextTwo" />
      <el-table-column label="" align="center" prop="proveTextThree" />
      <el-table-column label="盈利率" align="center" prop="profitRequested" />
      <el-table-column label="预估费用" align="center" prop="estimateFee" />
      <el-table-column label="" align="center" prop="dutyPersonName" />
      <el-table-column label="" align="center" prop="contractEstimateNo" />
      <el-table-column label="" align="center" prop="pingshenYn" />
      <el-table-column label="" align="center" prop="vendorAddress" />
      <el-table-column label="" align="center" prop="vendorForShort" />
      <el-table-column label="" align="center" prop="consigneeAddress" />
      <el-table-column label="" align="center" prop="consigneeShortName" />
      <el-table-column label="" align="center" prop="pingshengDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.pingshengDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="" align="center" prop="specProveUid" />
      <el-table-column label="" align="center" prop="currentBuyerCredit" />
      <el-table-column label="" align="center" prop="currentSellerCredit" />
      <el-table-column label="" align="center" prop="materialProductBuyPublishNo" />
      <el-table-column label="" align="center" prop="materialProductSalePublishNo" />
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="创建时间" align="center" prop="createDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="更新时间" align="center" prop="updateDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.updateDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="" align="center" prop="creditBillNo" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button v-hasPermission="['contract:conContract:update']" size="mini" type="text" icon="el-icon-edit" @click="handleEdit(scope.row)">修改</el-button>
          <el-button v-hasPermission="['contract:conContract:delete']" size="mini" type="text" icon="el-icon-delete" @click="handleRemove(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <!-- 分页 -->
    <pagination v-show="page.total>0" :total="page.total" :page.sync="page.current" :limit.sync="page.pageSize" @pagination="handleQuery" />

    <!-- 添加/修改对话框 -->
    <el-dialog :title="conContractFormDialog.title" :visible.sync="conContractFormDialog.visible" :close-on-click-modal="false" :before-close="resetConContractFormDialog" width="500px" append-to-body>
      <el-form ref="conContractForm" :model="conContractFormData" :rules="conContractFormRules" label-width="80px">
        <el-form-item label="" prop="contractNo">
          <el-input v-model="conContractFormData.contractNo" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="contractName">
          <el-input v-model="conContractFormData.contractName" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="purchaseOrderNo">
          <el-input v-model="conContractFormData.purchaseOrderNo" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="companyNo">
          <el-input v-model="conContractFormData.companyNo" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="dutyPerson">
          <el-input v-model="conContractFormData.dutyPerson" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="contractProperty">
          <el-input v-model="conContractFormData.contractProperty" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="tradeTermDesc">
          <el-input v-model="conContractFormData.tradeTermDesc" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="projectName">
          <el-input v-model="conContractFormData.projectName" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="verdorCode">
          <el-input v-model="conContractFormData.verdorCode" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="vendornm">
          <el-input v-model="conContractFormData.vendornm" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="consigneeId">
          <el-input v-model="conContractFormData.consigneeId" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="consigneeName">
          <el-input v-model="conContractFormData.consigneeName" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="contractSignDate">
          <el-date-picker v-model="conContractFormData.contractSignDate" type="date" value-format="yyyy-MM-dd" size="small" style="width: 100%" placeholder="选择" clearable />
        </el-form-item>
        <el-form-item label="" prop="contractSignAddress">
          <el-input v-model="conContractFormData.contractSignAddress" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="contractEffectDate">
          <el-date-picker v-model="conContractFormData.contractEffectDate" type="date" value-format="yyyy-MM-dd" size="small" style="width: 100%" placeholder="选择" clearable />
        </el-form-item>
        <el-form-item label="" prop="contractUneffectDate">
          <el-date-picker v-model="conContractFormData.contractUneffectDate" type="date" value-format="yyyy-MM-dd" size="small" style="width: 100%" placeholder="选择" clearable />
        </el-form-item>
        <el-form-item label="" prop="currencyCode">
          <el-input v-model="conContractFormData.currencyCode" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="paymenTerms">
          <el-input v-model="conContractFormData.paymenTerms" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="priceUneffectDate">
          <el-input v-model="conContractFormData.priceUneffectDate" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="productCode">
          <el-input v-model="conContractFormData.productCode" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="productCodeName">
          <el-input v-model="conContractFormData.productCodeName" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="departureCountry">
          <el-input v-model="conContractFormData.departureCountry" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="departureHarbor">
          <el-input v-model="conContractFormData.departureHarbor" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="deliveryCountry">
          <el-input v-model="conContractFormData.deliveryCountry" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="deliveryHarbor">
          <el-input v-model="conContractFormData.deliveryHarbor" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="deliveryAddress">
          <el-input v-model="conContractFormData.deliveryAddress" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="overseasFreightFee">
          <el-input v-model="conContractFormData.overseasFreightFee" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="domesticFreightFee">
          <el-input v-model="conContractFormData.domesticFreightFee" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="insuranceExpense">
          <el-input v-model="conContractFormData.insuranceExpense" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="palletCost">
          <el-input v-model="conContractFormData.palletCost" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="creditCost">
          <el-input v-model="conContractFormData.creditCost" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="commission">
          <el-input v-model="conContractFormData.commission" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="deliveryTermDesc">
          <el-input v-model="conContractFormData.deliveryTermDesc" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="deliveryTerm">
          <el-input v-model="conContractFormData.deliveryTerm" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="version">
          <el-input v-model="conContractFormData.version" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="noteText">
          <el-input v-model="conContractFormData.noteText" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="dutyDepartmentNo">
          <el-input v-model="conContractFormData.dutyDepartmentNo" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="customerName">
          <el-input v-model="conContractFormData.customerName" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="customerNo">
          <el-input v-model="conContractFormData.customerNo" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="settlementCurrencyNo">
          <el-input v-model="conContractFormData.settlementCurrencyNo" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="projectNo">
          <el-input v-model="conContractFormData.projectNo" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="supplierSite">
          <el-input v-model="conContractFormData.supplierSite" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="pickupAddress">
          <el-input v-model="conContractFormData.pickupAddress" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="depart">
          <el-input v-model="conContractFormData.depart" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="destination">
          <el-input v-model="conContractFormData.destination" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="paymentTerm">
          <el-input v-model="conContractFormData.paymentTerm" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="departPort">
          <el-input v-model="conContractFormData.departPort" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="destPort">
          <el-input v-model="conContractFormData.destPort" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="departPortAddress">
          <el-input v-model="conContractFormData.departPortAddress" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="destPortAddress">
          <el-input v-model="conContractFormData.destPortAddress" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="totProvect">
          <el-input v-model="conContractFormData.totProvect" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="nextProver">
          <el-input v-model="conContractFormData.nextProver" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="contractUploadPath">
          <el-input v-model="conContractFormData.contractUploadPath" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="lastProver">
          <el-input v-model="conContractFormData.lastProver" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="docCt">
          <el-input v-model="conContractFormData.docCt" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="attachment1">
          <el-input v-model="conContractFormData.attachment1" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="attachment2">
          <el-input v-model="conContractFormData.attachment2" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="attachment3">
          <el-input v-model="conContractFormData.attachment3" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="attachment4">
          <el-input v-model="conContractFormData.attachment4" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="attachment5">
          <el-input v-model="conContractFormData.attachment5" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="contractdoc4">
          <el-input v-model="conContractFormData.contractdoc4" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="contractdoc3">
          <el-input v-model="conContractFormData.contractdoc3" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="contractdoc2">
          <el-input v-model="conContractFormData.contractdoc2" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="contractdoc1">
          <el-input v-model="conContractFormData.contractdoc1" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="contractdoc5">
          <el-input v-model="conContractFormData.contractdoc5" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="attachmentotherdoc1">
          <el-input v-model="conContractFormData.attachmentotherdoc1" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="attachmentotherdoc2">
          <el-input v-model="conContractFormData.attachmentotherdoc2" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="contractdocname">
          <el-input v-model="conContractFormData.contractdocname" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="contractdocname2">
          <el-input v-model="conContractFormData.contractdocname2" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="是否为外贸合同" prop="isForeignTrade">
          <el-input v-model="conContractFormData.isForeignTrade" placeholder="请输入是否为外贸合同" />
        </el-form-item>
        <el-form-item label="" prop="outWarehouseAfterPayYn">
          <el-input v-model="conContractFormData.outWarehouseAfterPayYn" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="inWarehouseAfterPayDays">
          <el-input v-model="conContractFormData.inWarehouseAfterPayDays" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="invoiceAfterpayYn">
          <el-input v-model="conContractFormData.invoiceAfterpayYn" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="inWarehouseAfterPayYn">
          <el-input v-model="conContractFormData.inWarehouseAfterPayYn" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="invoiceAfterPayDays">
          <el-input v-model="conContractFormData.invoiceAfterPayDays" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="payAfterOutWarehouseDays">
          <el-input v-model="conContractFormData.payAfterOutWarehouseDays" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="prePayPercentBeforeOut">
          <el-input v-model="conContractFormData.prePayPercentBeforeOut" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="proveText">
          <el-input v-model="conContractFormData.proveText" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="proveTextOne">
          <el-input v-model="conContractFormData.proveTextOne" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="proveTextTwo">
          <el-input v-model="conContractFormData.proveTextTwo" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="proveTextThree">
          <el-input v-model="conContractFormData.proveTextThree" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="盈利率" prop="profitRequested">
          <el-input v-model="conContractFormData.profitRequested" placeholder="请输入盈利率" />
        </el-form-item>
        <el-form-item label="预估费用" prop="estimateFee">
          <el-input v-model="conContractFormData.estimateFee" placeholder="请输入预估费用" />
        </el-form-item>
        <el-form-item label="" prop="dutyPersonName">
          <el-input v-model="conContractFormData.dutyPersonName" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="contractEstimateNo">
          <el-input v-model="conContractFormData.contractEstimateNo" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="pingshenYn">
          <el-input v-model="conContractFormData.pingshenYn" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="vendorAddress">
          <el-input v-model="conContractFormData.vendorAddress" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="vendorForShort">
          <el-input v-model="conContractFormData.vendorForShort" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="consigneeAddress">
          <el-input v-model="conContractFormData.consigneeAddress" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="consigneeShortName">
          <el-input v-model="conContractFormData.consigneeShortName" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="pingshengDate">
          <el-date-picker v-model="conContractFormData.pingshengDate" type="date" value-format="yyyy-MM-dd" size="small" style="width: 100%" placeholder="选择" clearable />
        </el-form-item>
        <el-form-item label="" prop="specProveUid">
          <el-input v-model="conContractFormData.specProveUid" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="currentBuyerCredit">
          <el-input v-model="conContractFormData.currentBuyerCredit" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="currentSellerCredit">
          <el-input v-model="conContractFormData.currentSellerCredit" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="materialProductBuyPublishNo">
          <el-input v-model="conContractFormData.materialProductBuyPublishNo" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="materialProductSalePublishNo">
          <el-input v-model="conContractFormData.materialProductSalePublishNo" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="conContractFormData.remark" placeholder="请输入备注" />
        </el-form-item>
        <el-form-item label="创建时间" prop="createDate">
          <el-date-picker v-model="conContractFormData.createDate" type="date" value-format="yyyy-MM-dd" size="small" style="width: 100%" placeholder="选择创建时间" clearable />
        </el-form-item>
        <el-form-item label="更新时间" prop="updateDate">
          <el-date-picker v-model="conContractFormData.updateDate" type="date" value-format="yyyy-MM-dd" size="small" style="width: 100%" placeholder="选择更新时间" clearable />
        </el-form-item>
        <el-form-item label="" prop="creditBillNo">
          <el-input v-model="conContractFormData.creditBillNo" placeholder="请输入" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirmConContractFormDialog">确 定</el-button>
        <el-button @click="resetConContractFormDialog">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import ConContractApi from '@/api/contract/ConContractApi'

const defaultConContractFormData = {
  contractNo: null,
  contractName: null,
  purchaseOrderNo: null,
  companyNo: null,
  dutyPerson: null,
  contractType: null,
  contractProperty: null,
  tradeTermDesc: null,
  projectName: null,
  verdorCode: null,
  vendornm: null,
  consigneeId: null,
  consigneeName: null,
  contractSignDate: null,
  contractSignAddress: null,
  contractEffectDate: null,
  contractUneffectDate: null,
  paymentType: null,
  currencyCode: null,
  paymenTerms: null,
  priceUneffectDate: null,
  productCode: null,
  productCodeName: null,
  transportType: null,
  departureCountry: null,
  departureHarbor: null,
  deliveryCountry: null,
  deliveryHarbor: null,
  deliveryAddress: null,
  overseasFreightFee: null,
  domesticFreightFee: null,
  insuranceExpense: null,
  palletCost: null,
  creditCost: null,
  commission: null,
  deliveryTermDesc: null,
  deliveryTerm: null,
  version: null,
  noteText: null,
  status: '0',
  dutyDepartmentNo: null,
  customerName: null,
  customerNo: null,
  settlementCurrencyNo: null,
  projectNo: null,
  type: null,
  supplierSite: null,
  pickupAddress: null,
  depart: null,
  destination: null,
  paymentTerm: null,
  departPort: null,
  destPort: null,
  departPortAddress: null,
  destPortAddress: null,
  totProvect: null,
  nextProver: null,
  contractUploadPath: null,
  lastProver: null,
  approveStatus: '0',
  docCt: null,
  attachment1: null,
  attachment2: null,
  attachment3: null,
  attachment4: null,
  attachment5: null,
  contractdoc4: null,
  contractdoc3: null,
  contractdoc2: null,
  contractdoc1: null,
  contractdoc5: null,
  attachmentotherdoc1: null,
  attachmentotherdoc2: null,
  contractdocname: null,
  contractdocname2: null,
  isForeignTrade: null,
  outWarehouseAfterPayYn: null,
  inWarehouseAfterPayDays: null,
  invoiceAfterpayYn: null,
  inWarehouseAfterPayYn: null,
  invoiceAfterPayDays: null,
  payAfterOutWarehouseDays: null,
  prePayPercentBeforeOut: null,
  proveText: null,
  proveTextOne: null,
  proveTextTwo: null,
  proveTextThree: null,
  profitRequested: null,
  estimateFee: null,
  dutyPersonName: null,
  contractEstimateNo: null,
  pingshenYn: null,
  vendorAddress: null,
  vendorForShort: null,
  consigneeAddress: null,
  consigneeShortName: null,
  pingshengDate: null,
  specProveUid: null,
  currentBuyerCredit: null,
  currentSellerCredit: null,
  materialProductBuyPublishNo: null,
  materialProductSalePublishNo: null,
  createDate: null,
  updateDate: null,
  creditBillNo: null
}
export default {
  name: 'ConContractList',
  data() {
    return {
      options: {
        sysYnTypeOptions: this.$constant.sysYnTypeOptions
      },
      queryParams: {
        contractNo: null,
        contractName: null,
        purchaseOrderNo: null,
        companyNo: null,
        dutyPerson: null,
        contractType: null,
        contractProperty: null,
        tradeTermDesc: null,
        projectName: null,
        verdorCode: null,
        vendornm: null,
        consigneeId: null,
        consigneeName: null,
        contractSignDate: null,
        contractSignAddress: null,
        contractEffectDate: null,
        contractUneffectDate: null,
        paymentType: null,
        currencyCode: null,
        paymenTerms: null,
        priceUneffectDate: null,
        productCode: null,
        productCodeName: null,
        transportType: null,
        departureCountry: null,
        departureHarbor: null,
        deliveryCountry: null,
        deliveryHarbor: null,
        deliveryAddress: null,
        overseasFreightFee: null,
        domesticFreightFee: null,
        insuranceExpense: null,
        palletCost: null,
        creditCost: null,
        commission: null,
        deliveryTermDesc: null,
        deliveryTerm: null,
        version: null,
        noteText: null,
        status: null,
        dutyDepartmentNo: null,
        customerName: null,
        customerNo: null,
        settlementCurrencyNo: null,
        projectNo: null,
        type: null,
        supplierSite: null,
        pickupAddress: null,
        depart: null,
        destination: null,
        paymentTerm: null,
        departPort: null,
        destPort: null,
        departPortAddress: null,
        destPortAddress: null,
        totProvect: null,
        nextProver: null,
        contractUploadPath: null,
        lastProver: null,
        approveStatus: null,
        docCt: null,
        attachment1: null,
        attachment2: null,
        attachment3: null,
        attachment4: null,
        attachment5: null,
        contractdoc4: null,
        contractdoc3: null,
        contractdoc2: null,
        contractdoc1: null,
        contractdoc5: null,
        attachmentotherdoc1: null,
        attachmentotherdoc2: null,
        contractdocname: null,
        contractdocname2: null,
        isForeignTrade: null,
        outWarehouseAfterPayYn: null,
        inWarehouseAfterPayDays: null,
        invoiceAfterpayYn: null,
        inWarehouseAfterPayYn: null,
        invoiceAfterPayDays: null,
        payAfterOutWarehouseDays: null,
        prePayPercentBeforeOut: null,
        proveText: null,
        proveTextOne: null,
        proveTextTwo: null,
        proveTextThree: null,
        profitRequested: null,
        estimateFee: null,
        dutyPersonName: null,
        contractEstimateNo: null,
        pingshenYn: null,
        vendorAddress: null,
        vendorForShort: null,
        consigneeAddress: null,
        consigneeShortName: null,
        pingshengDate: null,
        specProveUid: null,
        currentBuyerCredit: null,
        currentSellerCredit: null,
        materialProductBuyPublishNo: null,
        materialProductSalePublishNo: null,
        createDate: null,
        updateDate: null,
        creditBillNo: null,
        isValid: this.$constant.Y
      },
      page: {
        current: 1,
        pageSize: 10,
        total: 0,
        records: []
      },
      conContractFormDialog: {
        title: '',
        visible: false
      },
      conContractFormData: Object.assign({}, defaultConContractFormData),
      conContractFormRules: {
        companyNo: [{ required: true, message: '不能为空', trigger: 'blur' }],
        createDate: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
        updateDate: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }]
      },
      loading: true,
      searchVisible: true,
      multipleSelection: [],
      isSingle: true,
      isMultiple: true
    }
  },
  created() {
    this.handleQuery()
    this.loadOptions()
  },
  methods: {
    loadOptions() {
    },
    handleAdd() {
      this.openConContractFormDialog()
    },
    handleRemove(row) {
      const ids = row.id || this.multipleSelection.map(item => item.id)
      this.$confirm('是否确认删除数据?', '警告', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(function() {
        return ConContractApi.remove(ids)
      }).then(() => {
        this.handleQuery()
        this.$message.success('删除成功')
      })
    },
    handleEdit(row) {
      const id = row.id || this.multipleSelection.map(item => item.id)[0]
      this.openConContractFormDialog(id)
    },
    handleQuery() {
      this.loading = true
      ConContractApi.page(this.queryParams, this.page).then(response => {
        this.page.records = response.data.records
        this.page.total = response.data.total
        this.loading = false
      }, () => {
        this.loading = false
      })
    },
    handleExport() {
      this.$confirm('是否确认导出数据?', '警告', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(function() {
        return ConContractApi.exportData(this.queryParams)
      }).then(response => {
        this.$common.download(response.msg)
      })
    },
    openConContractFormDialog(id) {
      this.conContractFormDialog.visible = true
      if (id) {
        this.conContractFormDialog.title = '合同主表-修改'
        ConContractApi.get(id).then(response => {
          this.conContractFormData = {
            ...this.conContractFormData,
            ...response.data
          }
        })
      } else {
        this.conContractFormDialog.title = '合同主表-添加'
      }
    },
    confirmConContractFormDialog() {
      this.$refs['conContractForm'].validate(valid => {
        if (valid) {
          if (this.conContractFormData.id) {
            ConContractApi.edit(this.conContractFormData).then(response => {
              this.$message.success('修改成功')
              this.resetConContractFormDialog()
              this.handleQuery()
            })
          } else {
            ConContractApi.add(this.conContractFormData).then(response => {
              this.$message.success('添加成功')
              this.resetConContractFormDialog()
              this.handleQuery()
            })
          }
        }
      })
    },
    resetConContractFormDialog() {
      this.conContractFormDialog = {
        title: '',
        visible: false
      }
      this.conContractFormData = Object.assign({}, defaultConContractFormData)
      this.resetForm('conContractForm')
    },
    handleSelectionChange(selection) {
      this.multipleSelection = selection
      this.isSingle = selection.length !== 1
      this.isMultiple = !selection.length
    },
    resetQuery() {
      this.page.current = 1
      this.resetForm('queryForm')
      this.handleQuery()
    }
  }
}
</script>
